<template>
  <div class="achievement" v-cloak>
    <div class="bg_color"></div>
    <div style="height: 4px;position: absolute;z-index: 2222; width: 100%; top: 46px;background: #f0f0f0"></div>
    <div style="height: 50px;"></div>
    <div class="about-us" v-show="show">
      <div v-html="content" class="con_term">

      </div>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'Terms',
    data () {
      return {
        show: true,
        content: ''
      }
    },
    methods: {
      getmode: function () {
        let mode = this.$chaos.config('mode')
        if (mode === 'website' && sessionStorage.content) {
          return JSON.parse(sessionStorage.content)
        } else if (mode === 'client' && localStorage.content) {
          let content = JSON.parse(localStorage.content)
          if (content.expire_time * 1000 < new Date().getTime()) {
            localStorage.content = null
            return false
          }
          return content
        } else {
          return false
        }
      },
      verify: function () {
        this.$chaos.setTitle('服务条款')
        this.$store.commit('headerShow', true)
        this.$store.commit('title', '服务条款')
        this.$store.commit('footerShow', false)
        this.content = this.getmode()
      }
    },
    created: function () {
      this.verify()
    },
    mounted: function () {
      window.scrollTo(0, 2000)
    },
    watch: {
      '$route': 'verify'
    }
  }
</script>
<style scoped>
  [v-cloak] {
    display: block;
  }
  body,
  html {
    background: #f9f9f9;
  }
  .con_term{
    padding: 0px 15px;
  }
</style>
